﻿using Prism.Commands;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TimeSolve
{
    public class MaterialWindowViewModel:BindableBase
    {
        public MaterialWindowViewModel(ContinuumVM continuum)
        {
            this.continuum = continuum;
       
            apply = new DelegateCommand(_apply);
        }
        private ContinuumVM continuum;
        public ObservableCollection<MaterialDataVM> avaliableMaterials { get; set; } 
        public MaterialDataVM selectedMaterial { get => _selectedMaterial; set { _selectedMaterial = value; RaisePropertyChanged("selectedPhysicalModel"); } }
        private MaterialDataVM _selectedMaterial;

        public DelegateCommand apply { get; set; }
        private void _apply()
        {
            if (selectedMaterial == null) return;
            //continuum.materialBase = selectedMaterial;
        }
        private void updateAvaliableMaterials()
        {
            //MaterialLibrary ml = new MaterialLibrary();

            //switch (continuum.physicalType)
            //{
            //    case PhysicalTypes.固体:
            //        avaliableMaterials = ml.solidList;
            //        break;
            //    case PhysicalTypes.流体:
            //        avaliableMaterials = ml.fluidList;
            //        break;
            //    default:
            //        break;
            //}
        }

    }
}
